Integrand size = 45, antiderivative size = 597 \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=-\frac {\left (a^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a^2 b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^3}-\frac {\left (3 a^2 b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-3 a b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^3 f}+\frac {\left (a^6 C d^2+3 a^4 b^2 C d^2-3 a^2 b^4 \left (c^2 C+2 B c d-2 C d^2-A \left (c^2-d^2\right )\right )+b^6 \left (c (c C+2 B d)-A \left (c^2-d^2\right )\right )-a^3 b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^5 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (a+b \tan (e+f x))}{b^3 \left (a^2+b^2\right )^3 f}-\frac {(b c-a d) \left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right )}{b^3 \left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2} \]
[Out]
Time = 1.45 (sec) , antiderivative size = 597, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3726, 3716, 3707, 3698, 31, 3556} \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{2 b f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}-\frac {(b c-a d) \left (a^4 C d-a^2 b^2 (d (A-3 C)+B c)+2 a b^3 (A c-B d-c C)+b^4 (A d+B c)\right )}{b^3 f \left (a^2+b^2\right )^2 (a+b \tan (e+f x))}-\frac {\log (\cos (e+f x)) \left (a^3 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )+3 a^2 b \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )-3 a b^2 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-b^3 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )\right )}{f \left (a^2+b^2\right )^3}-\frac {x \left (a^3 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )-3 a^2 b \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-3 a b^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )+b^3 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )}{\left (a^2+b^2\right )^3}+\frac {\left (a^6 C d^2+3 a^4 b^2 C d^2-a^3 b^3 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-3 a^2 b^4 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-2 C d^2\right )+3 a b^5 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )+b^6 \left (c (2 B d+c C)-A \left (c^2-d^2\right )\right )\right ) \log (a+b \tan (e+f x))}{b^3 f \left (a^2+b^2\right )^3} \]
[In]
[Out]
Rule 31
Rule 3556
Rule 3698
Rule 3707
Rule 3716
Rule 3726
Rubi steps \begin{align*} \text {integral}& = -\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}+\frac {\int \frac {(c+d \tan (e+f x)) \left (2 ((b B-a C) (b c-a d)+A b (a c+b d))-2 b ((A-C) (b c-a d)-B (a c+b d)) \tan (e+f x)+2 \left (a^2+b^2\right ) C d \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx}{2 b \left (a^2+b^2\right )} \\ & = -\frac {(b c-a d) \left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right )}{b^3 \left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}+\frac {\int \frac {2 \left (a^4 C d^2-a^2 b^2 \left (c^2 C+2 B c d-3 C d^2-A \left (c^2-d^2\right )\right )+b^4 \left (c (c C+2 B d)-A \left (c^2-d^2\right )\right )+2 a b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right )+2 b^2 \left (2 a b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \tan (e+f x)+2 \left (a^2+b^2\right )^2 C d^2 \tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{2 b^2 \left (a^2+b^2\right )^2} \\ & = -\frac {\left (a^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a^2 b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^3}-\frac {(b c-a d) \left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right )}{b^3 \left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}+\frac {\left (3 a^2 b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-3 a b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \int \tan (e+f x) \, dx}{\left (a^2+b^2\right )^3}+\frac {\left (a^6 C d^2+3 a^4 b^2 C d^2-3 a^2 b^4 \left (c^2 C+2 B c d-2 C d^2-A \left (c^2-d^2\right )\right )+b^6 \left (c (c C+2 B d)-A \left (c^2-d^2\right )\right )-a^3 b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^5 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \int \frac {1+\tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b^2 \left (a^2+b^2\right )^3} \\ & = -\frac {\left (a^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a^2 b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^3}-\frac {\left (3 a^2 b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-3 a b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^3 f}-\frac {(b c-a d) \left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right )}{b^3 \left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}+\frac {\left (a^6 C d^2+3 a^4 b^2 C d^2-3 a^2 b^4 \left (c^2 C+2 B c d-2 C d^2-A \left (c^2-d^2\right )\right )+b^6 \left (c (c C+2 B d)-A \left (c^2-d^2\right )\right )-a^3 b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^5 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (e+f x)\right )}{b^3 \left (a^2+b^2\right )^3 f} \\ & = -\frac {\left (a^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a^2 b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^3}-\frac {\left (3 a^2 b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-3 a b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^3 f}+\frac {\left (a^6 C d^2+3 a^4 b^2 C d^2-3 a^2 b^4 \left (c^2 C+2 B c d-2 C d^2-A \left (c^2-d^2\right )\right )+b^6 \left (c (c C+2 B d)-A \left (c^2-d^2\right )\right )-a^3 b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^5 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (a+b \tan (e+f x))}{b^3 \left (a^2+b^2\right )^3 f}-\frac {(b c-a d) \left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right )}{b^3 \left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2} \\ \end{align*}
Result contains complex when optimal does not.
Time = 7.04 (sec) , antiderivative size = 1041, normalized size of antiderivative = 1.74 \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=-\frac {\left (3 a^2 A b c^2-A b^3 c^2-a^3 B c^2+3 a b^2 B c^2-3 a^2 b c^2 C+b^3 c^2 C-2 a^3 A c d+6 a A b^2 c d-6 a^2 b B c d+2 b^3 B c d+2 a^3 c C d-6 a b^2 c C d-3 a^2 A b d^2+A b^3 d^2+a^3 B d^2-3 a b^2 B d^2+3 a^2 b C d^2-b^3 C d^2+i \left (a^3 A c^2-3 a A b^2 c^2+3 a^2 b B c^2-b^3 B c^2-a^3 c^2 C+3 a b^2 c^2 C+6 a^2 A b c d-2 A b^3 c d-2 a^3 B c d+6 a b^2 B c d-6 a^2 b c C d+2 b^3 c C d-a^3 A d^2+3 a A b^2 d^2-3 a^2 b B d^2+b^3 B d^2+a^3 C d^2-3 a b^2 C d^2\right )\right ) \log (i-\tan (e+f x))}{2 \left (a^2+b^2\right )^3 f}+\frac {\left (-3 a^2 A b c^2+A b^3 c^2+a^3 B c^2-3 a b^2 B c^2+3 a^2 b c^2 C-b^3 c^2 C+2 a^3 A c d-6 a A b^2 c d+6 a^2 b B c d-2 b^3 B c d-2 a^3 c C d+6 a b^2 c C d+3 a^2 A b d^2-A b^3 d^2-a^3 B d^2+3 a b^2 B d^2-3 a^2 b C d^2+b^3 C d^2+i \left (a^3 A c^2-3 a A b^2 c^2+3 a^2 b B c^2-b^3 B c^2-a^3 c^2 C+3 a b^2 c^2 C+6 a^2 A b c d-2 A b^3 c d-2 a^3 B c d+6 a b^2 B c d-6 a^2 b c C d+2 b^3 c C d-a^3 A d^2+3 a A b^2 d^2-3 a^2 b B d^2+b^3 B d^2+a^3 C d^2-3 a b^2 C d^2\right )\right ) \log (i+\tan (e+f x))}{2 \left (a^2+b^2\right )^3 f}+\frac {\left (a^6 C d^2+3 a^4 b^2 C d^2-3 a^2 b^4 \left (c^2 C+2 B c d-2 C d^2-A \left (c^2-d^2\right )\right )+b^6 \left (c (c C+2 B d)-A \left (c^2-d^2\right )\right )-a^3 b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^5 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (a+b \tan (e+f x))}{b^3 \left (a^2+b^2\right )^3 f}-\frac {\left (A b^2-a (b B-a C)\right ) (b c-a d)^2}{2 b^3 \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}+\frac {(b c-a d) \left (a^3 b B d-2 a^4 C d-b^4 (B c+2 A d)-a b^3 (2 A c-2 c C-3 B d)+a^2 b^2 (B c-4 C d)\right )}{b^3 \left (a^2+b^2\right )^2 f (a+b \tan (e+f x))} \]
[In]
[Out]
Time = 0.44 (sec) , antiderivative size = 865, normalized size of antiderivative = 1.45
method | result | size |
derivativedivides | \(\frac {-\frac {A \,a^{2} d^{2} b^{2}-2 A a \,b^{3} c d +A \,b^{4} c^{2}-B \,a^{3} d^{2} b +2 B \,a^{2} c d \,b^{2}-B a \,b^{3} c^{2}+a^{4} C \,d^{2}-2 C \,a^{3} c d b +C \,a^{2} c^{2} b^{2}}{2 b^{3} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}-\frac {-2 A \,a^{2} b^{3} c d +2 A a \,b^{4} c^{2}-2 A a \,b^{4} d^{2}+2 A \,b^{5} c d +B \,a^{4} b \,d^{2}-B \,a^{2} b^{3} c^{2}+3 B \,a^{2} b^{3} d^{2}-4 B a \,b^{4} c d +B \,b^{5} c^{2}-2 C \,a^{5} d^{2}+2 C \,a^{4} b c d -4 C \,a^{3} b^{2} d^{2}+6 C \,a^{2} b^{3} c d -2 C a \,b^{4} c^{2}}{b^{3} \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}+\frac {\left (-2 A \,a^{3} b^{3} c d +3 A \,a^{2} b^{4} c^{2}-3 A \,a^{2} b^{4} d^{2}+6 b^{5} A d c a -A \,b^{6} c^{2}+A \,b^{6} d^{2}-B \,a^{3} b^{3} c^{2}+B \,a^{3} b^{3} d^{2}-6 B \,a^{2} b^{4} c d +3 a \,b^{5} B \,c^{2}-3 B a \,b^{5} d^{2}+2 B \,b^{6} c d +a^{6} C \,d^{2}+3 a^{4} b^{2} C \,d^{2}+2 C \,a^{3} b^{3} c d -3 C \,a^{2} b^{4} c^{2}+6 C \,a^{2} b^{4} d^{2}-6 C a \,b^{5} c d +C \,b^{6} c^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3} b^{3}}+\frac {\frac {\left (2 A \,a^{3} c d -3 A \,a^{2} b \,c^{2}+3 A \,a^{2} b \,d^{2}-6 A a \,b^{2} c d +A \,b^{3} c^{2}-A \,b^{3} d^{2}+B \,a^{3} c^{2}-B \,a^{3} d^{2}+6 B \,a^{2} b c d -3 B a \,b^{2} c^{2}+3 B a \,b^{2} d^{2}-2 B \,b^{3} c d -2 C \,a^{3} c d +3 C \,a^{2} b \,c^{2}-3 C \,a^{2} b \,d^{2}+6 C a \,b^{2} c d -C \,b^{3} c^{2}+C \,b^{3} d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{3} c^{2}-A \,a^{3} d^{2}+6 A \,a^{2} b c d -3 A a \,b^{2} c^{2}+3 A a \,b^{2} d^{2}-2 A \,b^{3} c d -2 B \,a^{3} c d +3 B \,a^{2} b \,c^{2}-3 B \,a^{2} b \,d^{2}+6 B a \,b^{2} c d -B \,b^{3} c^{2}+B \,b^{3} d^{2}-C \,a^{3} c^{2}+C \,a^{3} d^{2}-6 C \,a^{2} b c d +3 C a \,b^{2} c^{2}-3 C a \,b^{2} d^{2}+2 C \,b^{3} c d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) | \(865\) |
default | \(\frac {-\frac {A \,a^{2} d^{2} b^{2}-2 A a \,b^{3} c d +A \,b^{4} c^{2}-B \,a^{3} d^{2} b +2 B \,a^{2} c d \,b^{2}-B a \,b^{3} c^{2}+a^{4} C \,d^{2}-2 C \,a^{3} c d b +C \,a^{2} c^{2} b^{2}}{2 b^{3} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}-\frac {-2 A \,a^{2} b^{3} c d +2 A a \,b^{4} c^{2}-2 A a \,b^{4} d^{2}+2 A \,b^{5} c d +B \,a^{4} b \,d^{2}-B \,a^{2} b^{3} c^{2}+3 B \,a^{2} b^{3} d^{2}-4 B a \,b^{4} c d +B \,b^{5} c^{2}-2 C \,a^{5} d^{2}+2 C \,a^{4} b c d -4 C \,a^{3} b^{2} d^{2}+6 C \,a^{2} b^{3} c d -2 C a \,b^{4} c^{2}}{b^{3} \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}+\frac {\left (-2 A \,a^{3} b^{3} c d +3 A \,a^{2} b^{4} c^{2}-3 A \,a^{2} b^{4} d^{2}+6 b^{5} A d c a -A \,b^{6} c^{2}+A \,b^{6} d^{2}-B \,a^{3} b^{3} c^{2}+B \,a^{3} b^{3} d^{2}-6 B \,a^{2} b^{4} c d +3 a \,b^{5} B \,c^{2}-3 B a \,b^{5} d^{2}+2 B \,b^{6} c d +a^{6} C \,d^{2}+3 a^{4} b^{2} C \,d^{2}+2 C \,a^{3} b^{3} c d -3 C \,a^{2} b^{4} c^{2}+6 C \,a^{2} b^{4} d^{2}-6 C a \,b^{5} c d +C \,b^{6} c^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3} b^{3}}+\frac {\frac {\left (2 A \,a^{3} c d -3 A \,a^{2} b \,c^{2}+3 A \,a^{2} b \,d^{2}-6 A a \,b^{2} c d +A \,b^{3} c^{2}-A \,b^{3} d^{2}+B \,a^{3} c^{2}-B \,a^{3} d^{2}+6 B \,a^{2} b c d -3 B a \,b^{2} c^{2}+3 B a \,b^{2} d^{2}-2 B \,b^{3} c d -2 C \,a^{3} c d +3 C \,a^{2} b \,c^{2}-3 C \,a^{2} b \,d^{2}+6 C a \,b^{2} c d -C \,b^{3} c^{2}+C \,b^{3} d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{3} c^{2}-A \,a^{3} d^{2}+6 A \,a^{2} b c d -3 A a \,b^{2} c^{2}+3 A a \,b^{2} d^{2}-2 A \,b^{3} c d -2 B \,a^{3} c d +3 B \,a^{2} b \,c^{2}-3 B \,a^{2} b \,d^{2}+6 B a \,b^{2} c d -B \,b^{3} c^{2}+B \,b^{3} d^{2}-C \,a^{3} c^{2}+C \,a^{3} d^{2}-6 C \,a^{2} b c d +3 C a \,b^{2} c^{2}-3 C a \,b^{2} d^{2}+2 C \,b^{3} c d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) | \(865\) |
norman | \(\text {Expression too large to display}\) | \(1447\) |
risch | \(\text {Expression too large to display}\) | \(4025\) |
parallelrisch | \(\text {Expression too large to display}\) | \(4626\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1699 vs. \(2 (595) = 1190\).
Time = 0.74 (sec) , antiderivative size = 1699, normalized size of antiderivative = 2.85 \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=\text {Too large to display} \]
[In]
[Out]
Exception generated. \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=\text {Exception raised: AttributeError} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 839, normalized size of antiderivative = 1.41 \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left ({\left ({\left (A - C\right )} a^{3} + 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} c^{2} - 2 \, {\left (B a^{3} - 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} c d - {\left ({\left (A - C\right )} a^{3} + 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} d^{2}\right )} {\left (f x + e\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {2 \, {\left ({\left (B a^{3} b^{3} - 3 \, {\left (A - C\right )} a^{2} b^{4} - 3 \, B a b^{5} + {\left (A - C\right )} b^{6}\right )} c^{2} + 2 \, {\left ({\left (A - C\right )} a^{3} b^{3} + 3 \, B a^{2} b^{4} - 3 \, {\left (A - C\right )} a b^{5} - B b^{6}\right )} c d - {\left (C a^{6} + 3 \, C a^{4} b^{2} + B a^{3} b^{3} - 3 \, {\left (A - 2 \, C\right )} a^{2} b^{4} - 3 \, B a b^{5} + A b^{6}\right )} d^{2}\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{6} b^{3} + 3 \, a^{4} b^{5} + 3 \, a^{2} b^{7} + b^{9}} + \frac {{\left ({\left (B a^{3} - 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} c^{2} + 2 \, {\left ({\left (A - C\right )} a^{3} + 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} c d - {\left (B a^{3} - 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {{\left (C a^{4} b^{2} - 3 \, B a^{3} b^{3} + {\left (5 \, A - 3 \, C\right )} a^{2} b^{4} + B a b^{5} + A b^{6}\right )} c^{2} + 2 \, {\left (C a^{5} b + B a^{4} b^{2} - {\left (3 \, A - 5 \, C\right )} a^{3} b^{3} - 3 \, B a^{2} b^{4} + A a b^{5}\right )} c d - {\left (3 \, C a^{6} - B a^{5} b - {\left (A - 7 \, C\right )} a^{4} b^{2} - 5 \, B a^{3} b^{3} + 3 \, A a^{2} b^{4}\right )} d^{2} - 2 \, {\left ({\left (B a^{2} b^{4} - 2 \, {\left (A - C\right )} a b^{5} - B b^{6}\right )} c^{2} - 2 \, {\left (C a^{4} b^{2} - {\left (A - 3 \, C\right )} a^{2} b^{4} - 2 \, B a b^{5} + A b^{6}\right )} c d + {\left (2 \, C a^{5} b - B a^{4} b^{2} + 4 \, C a^{3} b^{3} - 3 \, B a^{2} b^{4} + 2 \, A a b^{5}\right )} d^{2}\right )} \tan \left (f x + e\right )}{a^{6} b^{3} + 2 \, a^{4} b^{5} + a^{2} b^{7} + {\left (a^{4} b^{5} + 2 \, a^{2} b^{7} + b^{9}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (a^{5} b^{4} + 2 \, a^{3} b^{6} + a b^{8}\right )} \tan \left (f x + e\right )}}{2 \, f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1668 vs. \(2 (595) = 1190\).
Time = 1.01 (sec) , antiderivative size = 1668, normalized size of antiderivative = 2.79 \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=\text {Too large to display} \]
[In]
[Out]
Time = 27.62 (sec) , antiderivative size = 807, normalized size of antiderivative = 1.35 \[ \int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^3} \, dx=-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\frac {a^2\,\left (b^4\,\left (3\,A\,d^2-3\,A\,c^2+3\,C\,c^2-6\,C\,d^2+6\,B\,c\,d\right )+3\,C\,b^4\,d^2\right )-b^6\,\left (A\,d^2-A\,c^2+C\,c^2+2\,B\,c\,d\right )+C\,b^6\,d^2-a\,b^5\,\left (3\,B\,c^2-3\,B\,d^2+6\,A\,c\,d-6\,C\,c\,d\right )+a^3\,b^3\,\left (B\,c^2-B\,d^2+2\,A\,c\,d-2\,C\,c\,d\right )}{a^6\,b^3+3\,a^4\,b^5+3\,a^2\,b^7+b^9}-\frac {C\,d^2}{b^3}\right )}{f}-\frac {\frac {A\,b^6\,c^2-3\,C\,a^6\,d^2+B\,a\,b^5\,c^2+B\,a^5\,b\,d^2+5\,A\,a^2\,b^4\,c^2-3\,A\,a^2\,b^4\,d^2+A\,a^4\,b^2\,d^2-3\,B\,a^3\,b^3\,c^2+5\,B\,a^3\,b^3\,d^2-3\,C\,a^2\,b^4\,c^2+C\,a^4\,b^2\,c^2-7\,C\,a^4\,b^2\,d^2+2\,A\,a\,b^5\,c\,d+2\,C\,a^5\,b\,c\,d-6\,A\,a^3\,b^3\,c\,d-6\,B\,a^2\,b^4\,c\,d+2\,B\,a^4\,b^2\,c\,d+10\,C\,a^3\,b^3\,c\,d}{2\,b^3\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (B\,b^5\,c^2-2\,C\,a^5\,d^2+2\,A\,b^5\,c\,d+2\,A\,a\,b^4\,c^2-2\,A\,a\,b^4\,d^2+B\,a^4\,b\,d^2-2\,C\,a\,b^4\,c^2-B\,a^2\,b^3\,c^2+3\,B\,a^2\,b^3\,d^2-4\,C\,a^3\,b^2\,d^2-4\,B\,a\,b^4\,c\,d+2\,C\,a^4\,b\,c\,d-2\,A\,a^2\,b^3\,c\,d+6\,C\,a^2\,b^3\,c\,d\right )}{b^2\,\left (a^4+2\,a^2\,b^2+b^4\right )}}{f\,\left (a^2+2\,a\,b\,\mathrm {tan}\left (e+f\,x\right )+b^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (B\,c^2-B\,d^2+2\,A\,c\,d-2\,C\,c\,d-A\,c^2\,1{}\mathrm {i}+A\,d^2\,1{}\mathrm {i}+C\,c^2\,1{}\mathrm {i}-C\,d^2\,1{}\mathrm {i}+B\,c\,d\,2{}\mathrm {i}\right )}{2\,f\,\left (-a^3-a^2\,b\,3{}\mathrm {i}+3\,a\,b^2+b^3\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (A\,d^2-A\,c^2+B\,c^2\,1{}\mathrm {i}-B\,d^2\,1{}\mathrm {i}+C\,c^2-C\,d^2+A\,c\,d\,2{}\mathrm {i}+2\,B\,c\,d-C\,c\,d\,2{}\mathrm {i}\right )}{2\,f\,\left (-a^3\,1{}\mathrm {i}-3\,a^2\,b+a\,b^2\,3{}\mathrm {i}+b^3\right )} \]
[In]
[Out]